<template>
  <div class="main_box" style="padding:10px">
    <div class="add_wrap">
      <el-form label-width="200px">
      <div class="tit">
        <h2>基础信息</h2>
        <el-button type="success" plain size="small" icon="fa fa-mail-forward" @click="returnList">返回</el-button>
      </div>
      <el-row>
          <el-form-item label="地址类型:">
            <span>{{formatHouseType(dataInfo.houseType)}}</span>
          </el-form-item>
          <el-form-item label="联系人:">
            <span>{{dataInfo.linkName}}</span>
          </el-form-item>
          <el-form-item label="联系电话:">
            <span>{{dataInfo.linkPhone}}</span>
          </el-form-item>
          <el-form-item label="联系地址:">
            <span>{{dataInfo.splicingAddress}}</span>
          </el-form-item>
          <el-form-item label="wifi账号:">
            <span>{{dataInfo.wifiName}}</span>
          </el-form-item>
          <el-form-item label="wifi密码:">
            <span>{{dataInfo.wifiPwd}}</span>
          </el-form-item>
          <el-form-item label="创建人:">
            <span>{{ dataInfo.createUserName}}</span>
          </el-form-item>
          <el-form-item label="创建时间:">
            <span>{{ dataInfo.createDate }}</span>
          </el-form-item>
          <el-form-item label="修改人:">
            <span>{{ dataInfo.modifyUserName}}</span>
          </el-form-item>
          <el-form-item label="修改时间:">
            <span>{{ dataInfo.modifyDate }}</span>
          </el-form-item>
          <el-form-item label="备注:">
            <span>{{dataInfo.remark}}</span>
          </el-form-item>
      </el-row>
      </el-form>
    </div>
  </div>
</template>

<script>
import DeviceLocationApi from '@/api/address/deviceLocation';
export default {
  data() {
    return {
      dataInfo: {},
      fromType: 1
    };
  },
  mounted(){
    this.getData()
  },
  methods: {
    getData() {
     DeviceLocationApi.getHouseInfo({id:this.$route.query.id}).then(res=>{
        this.dataInfo = res.data
      })
    },
    formatHouseType(cellValue){
       if (cellValue === 1) {
            return '住家'
        } else if (cellValue === 2) {
            return '办公'
        }
    },
    returnList() {
      this.$store.dispatch('delView', this.$route);
      this.$router.push({ path:'/address/deviceLocationManagement'})
    }
  },

}

</script>
<style lang="scss" scoped>
@import "@/assets/css/views/add.scss";
</style>
